package vmcs.simulationsystem;

import java.awt.event.ItemListener;
import java.awt.event.ActionEvent;

/**
 * Title:        VMCS
 * Description:
 * Copyright:    Copyright (c) 2001
 * Company:      ISS
 * @author Pang Pingli
 * @version 1.0
 */

 import java.awt.*;
import java.awt.event.*;

import vmcs.controller.MachineryController;
import vmcs.store.StoreController;

public class DoorListener implements ItemListener {
  private MachineryController  machineryController;

  public DoorListener(MachineryController  machineryController) {
	  this.machineryController = machineryController;
  }
  public void itemStateChanged(ItemEvent e) {
	Checkbox cb;
	cb = (Checkbox)e.getSource();
	System.out.println("DoorListener:" + cb.getState());
	// true: isOpen = false, false: isOpen = true;
	machineryController.setDoorState(cb.getState());
  }
}